import { request } from '@/plugins/request'

// 获取公共文章列表
export const getArticles = params =>
  request({
    url: `/api/articles`,
    method: 'get',
    params
  })

// 获取公共文章列表
export const getArticlesFee = params =>
  request({
    url: `/api/articles/feed`,
    method: 'get',
    params
  })


// 获取标签列表
export const getTags = () =>
  request({
    url: `/api/tags`,
    method: 'get'
  })

// 添加点赞
export const addFavorite = slug =>
  request({
    url: `/api/articles/${slug}/favorite`,
    method: 'post'
  })


// 删除点赞
export const delFavorite = slug =>
  request({
    url: `/api/articles/${slug}/favorite`,
    method: 'delete'
  })


